package com.example.mushroom.service.impl;

import com.example.mushroom.entity.SensorData;
import com.example.mushroom.mapper.SensorDataMapper;
import com.example.mushroom.service.SensorDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;

@Service
public class SensorDataServiceImpl implements SensorDataService {

    @Autowired
    private SensorDataMapper sensorDataMapper;

    @Override
    public int insertSensorData(SensorData sensorData) {
        return sensorDataMapper.insertSensorData(sensorData);
    }

    @Override
    public SensorData selectSensorDataById(Integer id) {
        return sensorDataMapper.selectSensorDataById(id);
    }

    @Override
    public List<SensorData> selectAllSensorData() {
        return sensorDataMapper.selectAllSensorData();
    }

    @Override
    public List<SensorData> selectSensorDataByTimeRange(Date start, Date end) {
        return sensorDataMapper.selectSensorDataByTimeRange(start, end);
    }

    @Override
    public int updateSensorData(SensorData sensorData) {
        return sensorDataMapper.updateSensorData(sensorData);
    }

    @Override
    public int deleteSensorDataById(Integer id) {
        return sensorDataMapper.deleteSensorDataById(id);
    }

    @Override
    public List<SensorData> selectSensorDataByPage(int offset, int limit) {
        return sensorDataMapper.selectSensorDataByPage(offset, limit);
    }
}